package com.prism.e4.rcp.ui.palette;

import org.eclipse.gef.requests.CreationFactory;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.ImageData;

public class DomElementFactory implements CreationFactory {
	
	protected Class classType;

	public DomElementFactory(Class classType) {
		this.classType = classType;
	}
	
	@Override
	public Object getNewObject() {
		try {
			return (Element) classType.newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public Object getObjectType() {
		return classType;
	}
	
}
